package mysql

import "gorm.io/gorm"

type Category struct {
	gorm.Model
	CateName string `gorm:"type:varchar(30);not null;commit:'类别名称'"`
}

func (c *Category) FindName(db *gorm.DB, name string) error {
	return db.Debug().Where("cate_name=?", name).
		FirstOrCreate(c).Error
}
